package com.example.shapetext;

public class Triangle extends Shape1{
    double bottom; //底
    double high;

    double a; //左边
    double b; //右边

    public Triangle(double bottom, double high, double a, double b) {
        this.bottom = bottom;
        this.high = high;
        this.a = a;
        this.b = b;
    }

    @Override
    public void getParameter() {
       double c = a+b+bottom;
        System.out.println("三角形周长是"+c);
    }

    @Override
    public void getArea() {
        double s = bottom*high/2;
        System.out.println("三角形面积是"+s);
    }
}
